﻿using System;
using System.Windows.Data;
using System.Windows;

namespace TheVerge.Phone.Converters {
	public class BooleanVisibilityConverter : IValueConverter {

		public Visibility TrueVisibility { get; set; }
		public Visibility FalseVisibility { get; set; }

		public BooleanVisibilityConverter() {
			TrueVisibility = Visibility.Visible;
			FalseVisibility = Visibility.Collapsed;
		}

		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
			if (true.Equals(value)) return TrueVisibility;
			else return FalseVisibility;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
			throw new NotImplementedException();
		}

		#endregion
	}
}
